<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>体检报告</title>
    <%- include('../_global/baseLibsJKDA') %>
    <link rel="stylesheet" href="/static/css/jkda/public.css"/>
    <link rel="stylesheet" href="/static/css/jkda/page-main.css"/>
    <!--<link rel="stylesheet" href="/static/css/public.css">-->

<style type="text/css">
html,body {
	width: 100%;
	height: 100%;
	margin: 0px;
}
#ListTabBox .tab{ display: block!important;}
</style>


</head>

<body>
  <!-- <div class="search-nav">
    <i class="search"></i>
    <input type="text" placeholder="输入检查单号" id="JCDH" onkeyup="filterContent()">
  </div> -->
  <div id="ListTabBox">
    <div class="tab"> <div class="mz-list"  >
      <ul id= "tjbg" ></ul></div></div>
  </div> 
</body>
<script type="text/javascript">



    var page_tjbg = (function($, page_tjbg) {
        function indata(){
            var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
            $.QuickRemote.AjaxJson(goal_jkda_service+"/jkda/queryJkdaTjbg", page_tjbg.queryJkdaTjbgBack,{ZXWYH: zxwyh});
        }

        //体检报告回调
        function queryJkdaTjbgBack(result){
            page_tjbg.appendToTjbg(result);
        }
        //添加体检报告回调
        function appendToTjbg(result){
            var lis = [];
            if(result.length != 0){
                var resultBak =result.sort(page_tjbg.sortNumber);
                $(resultBak).each(function(){
                    var ywzys = this["YWZY"].split("}|{");
                    var tjbg = ywzys[0].split("^|^");
                    var tjrq = tjbg[0];
                    var jkzd = tjbg[2];
                    var jy = tjbg[3];
                    var tjjg = tjbg[4];
                    var li= $("<li>");
                    var div = $("<a>");
                    div.attr("class", "li-box");
                    /* var div = $("<a>");
                    div.attr("class", "li-box"); */

                    var div1 = $("<div>");
                    div1.attr("class", "black-block");
                    var span1 = $("<span>");
                    span1.html("体检日期：" );
                    span1.appendTo(div1);
                    var span2 = $("<span>");
                    var str;
                    var date;
                    if(StringUtils.isEmpty(tjrq)){
                        str = tjrq;
                    }else{
                        date = new Date(tjrq.replace(/(\d{4})(\d{2})(\d{2})/g,'$1-$2-$3'));
                        str = date.Format("yyyy-MM-dd");
                    }
                    span2.html(str);
                    //span2.html(tjrq);
                    span2.appendTo(div1);
                    div1.appendTo(div);

                    var div2 = $("<div>");
                    div2.attr("class", "black-block");
                    var span3 = $("<span>");
                    span3.html("健康指导：" );
                    span3.appendTo(div2);
                    var span4 = $("<span>");
                    span4.html(jkzd);
                    span4.appendTo(div2);
                    div2.appendTo(div);

                    var div3 = $("<div>");
                    div3.attr("class", "black-block");
                    var span5 = $("<span>");
                    span5.html("建议：" );
                    span5.appendTo(div3);
                    var span6 = $("<span>");
                    span6.html(jy);
                    span6.appendTo(div3);
                    div3.appendTo(div);

                    var div4 = $("<div>");
                    div4.attr("class", "black-block");
                    var span7 = $("<span>");
                    span7.html("体检机构：" );
                    span7.appendTo(div4);
                    var span8 = $("<span>");
                    span8.html(tjjg);
                    span8.appendTo(div4);
                    div4.appendTo(div);
                    div.appendTo(li);

                    div.data("info",ywzys);
                    div.on("click",function(){
                        var info = $(this).data("info");
                        StoreCache.setCache("jkdaTjbgCache", info);
                        $.QuickUrlUtils.redirectJSBridge({url:jkda_view+"/tjbg/tjbgDetail.ejs", title:"体检报告详情"});
                    });

                    lis.push(li);
                });
            }else{
                var li= $("<li>");
                var div0 = $("<div>");
                div0.attr("class", "black-block");

                div0.attr("style","width:100%;text-align:center; font-weight:bold;color:#000;padding-top:20px");
                div0.html("暂无信息");

                div0.appendTo(li);

                lis.push(li);
            }
            $("#tjbg").html(lis);
        }

        function sortNumber(a,b) {
            return b - a;
        }

        var cfg_def = {
            indata: indata,
            queryJkdaTjbgBack: queryJkdaTjbgBack,
            appendToTjbg: appendToTjbg,
            sortNumber: sortNumber,
        }

        page_tjbg.init = function(cfg){
            $.extend(page_tjbg, cfg_def, cfg);
            page_tjbg.indata();

        }

        return page_tjbg;
    })(jQuery, {});
    
</script>

</html>